/*
 * Copyright (c) 2025, 大连理工大学 (Dalian University of Technology)
 *
 * Licensed under the Mulan PSL v2.
 * You can use this file according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of the License at
 *
 *     http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. SEE THE MULAN PSL v2
 * FOR MORE DETAILS.
 */

#pragma once

#include "Utility/Configuration/SGParameter.h"

#include "DBManager/Common/DBManagerExport.h"
#include "DBManager/DBServiceFactory.h"

SG_DBMANAGER_NAMESPACE_OPEN

class DBManager_DECLSPEC IParameterService
{
  public:
    virtual ~IParameterService () {};

    /// @brief 初始化普通参数列表
    /// @param entity
    virtual void Initial (SG::Utility::SGParameter entity) = 0;

    /**
     * @brief    Get the Parameter object
     *
     * @return
     * @author   wuxingchuang
     * @date     2025.02.11
     */
    virtual SG::Utility::SGParameter GetSolverParameter () const = 0;

    /**
     * @brief    Add Executive System Parameter
     *
     * @param    entity
     * @author   wuxingchuang
     * @date     2025.02.11
     */
    virtual void AddExecutiveSystem (SG::Utility::SGParameter entity) = 0;

    /**
     * @brief    Get the Executive System Parameter object
     *
     * @return
     * @author   wuxingchuang
     * @date     2025.02.11
     */
    virtual SG::Utility::SGParameter GetExecutiveSystemParameter () = 0;

    ///@{ @brief get/set custom parameter value

    /// @brief 返回所有的自定义参数
    virtual SG::Utility::SGParameter GetCustomParameter () const = 0;

    virtual void SetCustomParameter (std::string key, bool value)        = 0;
    virtual void SetCustomParameter (std::string key, int32_t value)     = 0;
    virtual void SetCustomParameter (std::string key, double value)      = 0;
    virtual void SetCustomParameter (std::string key, std::string value) = 0;
    ///}@
};

template <>
std::shared_ptr<IParameterService> DBManager_DECLSPEC DBServiceFactory::get ();

SG_DBMANAGER_NAMESPACE_CLOSE
